#-*- coding:utf-8 -*-

import paramiko

transport = paramiko.Transport(('localhost', 22))
transport.connect(username='lxl', password='8901')
sftp = paramiko.SFTPClient.from_transport(transport) 
sftp.get('/home/lxl/python_ftp/ssh_file/long.txt', '/home/lxl/long.txt')    #将Linux上的/root/Linux.txt下载到本地
transport.close()